package com.yc.index.web;

import com.yc.entity.Admin;
import com.yc.entity.Collect;
import com.yc.entity.Record;
import com.yc.entity.User;
import com.yc.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "Carttoon-user" )
public interface UserAction {
    @RequestMapping("user/login")
    public Result login(@RequestParam String name, @RequestParam String password);

    @RequestMapping("user/queryAll")
    public List< User > queryAll();

    @RequestMapping("user/queryByUcount")
    public List< User > queryByUcount(@RequestParam String ucount);

    @RequestMapping("user/queryByUid")
    public List<User> queryByUid(@RequestParam Integer uid);

    @RequestMapping("user/freeze")
    public Integer freeze(@RequestParam(value = "uid") Integer uid,@RequestParam(value = "isfreeze") Boolean isfreeze);

    @PostMapping("user/sendmail")
    public Result sendmail(User user);

    @PostMapping("user/register")
    public Result register(@RequestBody Map map);

    @PostMapping("user/selectuser")
    public Result selectuser(@RequestParam String ucount);

    @PutMapping("user/modify")
    public Result modify(@RequestBody User user);

    @PutMapping("user/removemail")
    public Result removemail(@RequestParam(value = "ucount") String ucount,@RequestParam(value = "email") String email, @RequestParam(value = "mailcode") String mailcode);

    @PutMapping("user/findpass")
    public Result findpass(@RequestBody Map map);

    @PostMapping("collect/querycollect")
    public List<Collect> querycollect(@RequestParam String ucount);

    @RequestMapping("admin/login")
    public Result loginAdmin(@RequestParam String name, @RequestParam String password);

    @PutMapping("admin/findpass")
    public Result findpass_admin(@RequestBody Map map);

    @RequestMapping("admin/queryByAdname")
    public List< Admin > queryByAdname(@RequestParam String name);

    @RequestMapping("admin/updateAdminInfo")
    public Integer updateAdminInfo(@RequestBody List<Admin> adminList);

    @RequestMapping("admin/updateAdminPwd")
    public Integer updateAdminPwd(@RequestBody List<Admin> adminList,@RequestParam String newpwd);

    @RequestMapping("collect/addCollect")
    public Integer addCollect(@RequestParam Integer uid,@RequestParam Integer ctid);

    @RequestMapping("collect/cancelcollect")
    public Integer cancelcollect(@RequestParam Integer uid,@RequestParam Integer ctid);

    @RequestMapping("collect/checkCollected")
    public List< Collect > checkCollected(@RequestParam Integer uid, @RequestParam Integer ctid);

    @PostMapping("collect/deletecollect")
    public Result deletecollect(@RequestParam String ucount,@RequestParam Integer ctid);

    @PostMapping("collect/deletecollectList")
    public Result deletecollectList(@RequestParam String ucount,@RequestParam String str);

    @RequestMapping("record/queryByUid")
    public List< Record > queryByUidRecord(@RequestParam Integer uid);

    @RequestMapping("record/addRecord")
    public Integer addRecord(@RequestParam Integer uid,@RequestParam Integer ctid,@RequestParam Integer pid);

    @RequestMapping("record/deleteByRcid")
    public Integer deleteByRcid(@RequestParam Integer rcid);

    @RequestMapping("record/deleteByRcidList")
    public Integer deleteByRcidList(@RequestBody Integer[] rcidlist);

    @RequestMapping("record/deleteAllPlays")
    public Integer deleteAllPlays(@RequestParam Integer uid);

    @RequestMapping("record/queryByUidAndCtid")
    public List<Record> queryByUidAndCtid(@RequestParam Integer uid,@RequestParam Integer ctid);

    @RequestMapping("record/updateRecord")
    public Integer updateRecord(@RequestBody Record record,@RequestParam Integer pid);
}
